import request from '@/utils/request.js'
// export function getSearchResultApi (page, q) {
//   return request.get(`search?page=${page}&q=${q}`)
// }
export function getSearchResultApi ({ page = 1, perPage = 20, q }) { // 参数设置默认值
  return request.get('search', {
    params: {
      page,
      per_page: perPage,
      q
    }
  })
}
/**
 * 联想自动补全
 * @param {*} q 搜索词
 */
export function suggestApi (q) {
  return request.get('suggestion', {
    params: {
      q
    }
  })
}
